package com.penjin.android.view;

import android.content.Context;
import android.text.Layout;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.baidu.mapapi.map.Text;
import com.penjin.android.R;

/**
 * Created by Administrator on 2016/4/14.
 */
public class LocationInfoView extends LinearLayout {
    TextView info;
    ImageView icon;

    public LocationInfoView(Context context) {
        super(context);
        init(context, null);
    }

    public LocationInfoView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init(context, attrs);
    }

    public LocationInfoView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    private void init(Context context, AttributeSet attrs) {
        LayoutInflater.from(context).inflate(R.layout.layout_view_locationinfo, this);
        info = (TextView) findViewById(R.id.info);
        icon = (ImageView) findViewById(R.id.icon);
    }

    public void setInfo(String msg) {
        info.setText(msg);
    }

    public String getInfo() {
        return this.info.getText().toString();
    }
}
